﻿using System.Collections.Generic;

namespace Currency.Infra.Caching.Configurations
{
    /// <summary>
    /// Redis 配置文件
    /// </summary>
    public sealed class ConnectionConfig
    {

        public ConnectionConfig()
        {

        }

        /// <summary>
        /// Reids 用户名
        /// </summary>
        public string Username { get; set; } = null;

        /// <summary>
        /// Reids 密码
        /// </summary>
        public string Password { get; set; } = null;

        /// <summary>
        /// 连接配置
        /// </summary>
        public List<EndPoints> Dbconfig { get; set; }

        /// <summary>
        /// 连接字符串
        /// </summary>
        public string ConnectionString { get; set; }

        /// <summary>
        /// 获取或设置缓存将使用的Redis数据库索引。
        /// </summary>
        public int DatabaseIndex { get; set; } = 0;

        /// <summary>
        /// 如果该值大于零，则设置的缓存项的过期时间将按照该值随机增加
        /// 这主要是为了防止缓存崩溃
        /// </summary>
        public int MaxRdSecond { get; set; } = 0;

        /// <summary>
        /// 获取或设置一个值是否启用日志
        /// </summary>
        public bool EnableLogging { get; set; }
    }
}
